home *** CD-ROM | disk | FTP | other *** search
- Path: news.wwa.com!rmartin
- From: rmartin@oma.com (Robert C. Martin)
- Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
- Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
- Date: 10 Apr 1996 18:40:14 GMT
- Organization: Object Mentor
- Message-ID: <RMARTIN.96Apr10134014@rcm.oma.com>
- References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk>
- <RMARTIN.96Apr9160010@rcm.oma.com> <goochb.325.00160E30@rwi.com>
- NNTP-Posting-Host: rcm.oma.com
- In-reply-to: goochb@rwi.com's message of Tue, 9 Apr 1996 22:03:10
-
- In article <goochb.325.00160E30@rwi.com> goochb@rwi.com (William D. Gooch) writes:
-
- Matt Kennel writes:
- > A garbage collector provides a potential solution that is very
- > difficult to do without.
-
- rmartin@oma.com (Robert C. Martin) writes:
-
- >In some cases. In others it is difficult to live with. There is
- >no generic solution.
-
- Cute, but a litle too glib perhaps. Since (from what you wrote earlier)
- you know that a quality GC implementation allows one to turn it on
- and off, force collection, and do one's own memory management,
- what basis does that leave for GC being "hard to live with?"
-
- I said it was hard to live with "in some cases". And my meaning was
- that there are cases in which automatic collection of garbage is not a
- good option. Specifically I am talking about those cases where the
- management of the automatic collector becomes more complex than the
- manual management of memory.
-
- This happens in real time systems when you enter a very critical
- stretch of code. You cannot afford a collection within this stretch.
- So you turn off collection before you enter it. (Forget to do this,
- and you have an intermittent system crash).
-
- But if you turn off collection, you risk running out of memory. The
- system might just be running out when you decide to turn off
- collection. Now your critical stretch of code fails because it ran
- out of memory... So you have to do a collection before you enter the
- critical section, and before you turn collection off.
-
- Then you have to remember to turn collection back on when you exit the
- critical section.....
-
- Please understand, I am not arguing against GC. I am saying that GC
- is not a foolproof solution. There are times when managing GC is just
- as complex as manual memory management.
-
-
-
-
- --
- Robert Martin | Design Consulting | Training courses offered:
- Object Mentor Assoc.| rmartin@oma.com | OOA/D, C++, Advanced OO
- 14619 N. Somerset Cr| Tel: (847) 918-1004 | Mgt. Overview of OOT
- Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com
-
-